// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   SourceFile

package com.sgame.android.data;

import android.os.Parcel;
import android.os.Parcelable;
//import com.mobage.global.android.data.a.a;
import org.json.JSONException;
import org.json.JSONObject;

// Referenced classes of package com.mobage.global.android.data:
//            TunnelTransmittable

public class Score
    implements Parcelable, TunnelTransmittable
{
    public enum Field
    {
        UID, USER_ID, SCORE_VALUE, DISPLAY_VALUE, RANK;
    }


    public Score()
    {
        a = "";
        b = "";
        c = 0.0D;
        d = "";
        e = 0;
    }

    public Score(JSONObject obj)
    {
        a = "";
        b = "";
        c = 0.0D;
        d = "";
        e = 0;
        setFromJson(obj);
    }

    public String getId()
    {
        return a;
    }

    public void setId(String uid)
    {
        a = uid;
    }

    public String getUid()
    {
        return a;
    }

    public void setUid(String uid)
    {
        a = uid;
    }

    public String getUserId()
    {
        return b;
    }

    public void setUserId(String userId)
    {
        b = userId;
    }

    public double getScoreValue()
    {
        return c;
    }

    public void setScoreValue(double scoreValue)
    {
        c = scoreValue;
    }

    public String getDisplayValue()
    {
        return d;
    }

    public void setDisplayValue(String displayValue)
    {
        d = displayValue;
    }

    public int getRank()
    {
        return e;
    }

    public void setRank(int rank)
    {
        e = rank;
    }

    public void setFromJson(JSONObject json)
    {
        a = json.optString(Field.UID.name());
        b = json.optString(Field.USER_ID.name());
        c = json.optDouble(Field.SCORE_VALUE.name());
        d = json.optString(Field.DISPLAY_VALUE.name());
        e = json.optInt(Field.RANK.name());
    }

    public JSONObject toJson()
    {
        JSONObject jsonobject = new JSONObject();
        try {
			jsonobject.put(Field.UID.name(), a);
	        jsonobject.put(Field.USER_ID.name(), b);
	        jsonobject.put(Field.SCORE_VALUE.name(), c);
	        jsonobject.put(Field.DISPLAY_VALUE.name(), d);
	        jsonobject.put(Field.RANK.name(), e);
		} catch (JSONException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
        return jsonobject;
    }

    public int describeContents()
    {
        return 0;
    }

    public void writeToParcel(Parcel dest, int i)
    {
        dest.writeString(a);
        dest.writeString(b);
        dest.writeDouble(c);
        dest.writeString(d);
        dest.writeInt(e);
    }

    private Score(Parcel in)
    {
        a = "";
        b = "";
        c = 0.0D;
        d = "";
        e = 0;
        a = in.readString();
        b = in.readString();
        c = in.readDouble();
        d = in.readString();
        e = in.readInt();
    }

    public String toJsonStringForTunnel()
    {
    //    return com.mobage.global.android.data.a.a.a("Score", toJson());
    	return null;
    }

    public void updateWithJsonObjectFromTunnel(JSONObject jsonObject)
    {
        setFromJson(jsonObject);
    }

    Score(Parcel x0, byte byte0)
    {
        this(x0);
    }

    private String a;
    private String b;
    private double c;
    private String d;
    private int e;
    
    public static final android.os.Parcelable.Creator<Object> CREATOR = new android.os.Parcelable.Creator<Object>() {

        public final Object[] newArray(int i)
        {
            return new Score[i];
        }

        public final Object createFromParcel(Parcel parcel)
        {
            return new Score(parcel, (byte)0);
        }

    };

}
